﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Model
{
    public partial class T_EarningRecordsObject
    {
        private System.Int32 db_OID;
        private System.String db_EarningItem;
        private System.Int32 db_EarningObject;
        private System.Decimal db_EarningSum;
        private System.DateTime db_EarningDate;
        private System.Int32 db_EarningCategory;
        private System.String db_EarningMemo;

        public System.Int32 Db_OID
        {
            get { return db_OID; }
            set { db_OID = value; }
        }
        public System.String Db_EarningItem
        {
            get { return db_EarningItem; }
            set { db_EarningItem = value; }
        }
        public System.Int32 Db_EarningObject
        {
            get { return db_EarningObject; }
            set { db_EarningObject = value; }
        }
        public System.Decimal Db_EarningSum
        {
            get { return db_EarningSum; }
            set { db_EarningSum = value; }
        }
        public System.DateTime Db_EarningDate
        {
            get { return db_EarningDate; }
            set { db_EarningDate = value; }
        }
        public System.Int32 Db_EarningCategory
        {
            get { return db_EarningCategory; }
            set { db_EarningCategory = value; }
        }
        public System.String Db_EarningMemo
        {
            get { return db_EarningMemo; }
            set { db_EarningMemo = value; }
        }

        public void Data2Object(DataRow value)
        {
            if (value["OID"] != DBNull.Value)
                db_OID = System.Int32.Parse(value["OID"].ToString());
            db_EarningItem = value["EarningItem"].ToString();
            if (value["EarningObject"] != DBNull.Value)
                db_EarningObject = System.Int32.Parse(value["EarningObject"].ToString());
            if (value["EarningSum"] != DBNull.Value)
                db_EarningSum = System.Decimal.Parse(value["EarningSum"].ToString());
            if (value["EarningDate"] != DBNull.Value)
                db_EarningDate = System.DateTime.Parse(value["EarningDate"].ToString());
            if (value["EarningCategory"] != DBNull.Value)
                db_EarningCategory = System.Int32.Parse(value["EarningCategory"].ToString());
            db_EarningMemo = value["EarningMemo"].ToString();
        }

        public DataRow Object2Data(ref DataRow value)
        {
            value["OID"] = db_OID;
            value["EarningItem"] = db_EarningItem;
            value["EarningObject"] = db_EarningObject;
            value["EarningSum"] = db_EarningSum;
            value["EarningDate"] = db_EarningDate;
            value["EarningCategory"] = db_EarningCategory;
            value["EarningMemo"] = db_EarningMemo;
            return value;
        }
    } // end of class
}
